home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / INFOPATH.NL-NL / INFLR.CAB / FL_TransformXmltoHtmlUsingaXslStylesheet_s_142741_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2005-10-28  |  2KB  |  54 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.   <CodeSnippet Format="1.0.0">
  4.     <Header>
  5.       <Title>Transform XML into HTML using a XSL Stylesheet</Title>
  6.       <Author>Microsoft Corporation</Author>
  7.       <Description>Transforms XML into HTML using a XSL stylesheet.</Description>
  8.       <Shortcut>xmlXsl</Shortcut>
  9.     </Header>
  10.     <Snippet>
  11.       <References>
  12.         <Reference>
  13.           <Assembly>System.Xml.dll</Assembly>
  14.           <Url />
  15.         </Reference>
  16.       </References>
  17.       <Imports>
  18.         <Import>
  19.           <Namespace>System.IO</Namespace>
  20.         </Import>
  21.         <Import>
  22.           <Namespace>System.Xml.Xsl</Namespace>
  23.         </Import>
  24.       </Imports>
  25.       <Declarations>
  26.         <Literal>
  27.           <ID>OutputFile</ID>
  28.           <Type>String</Type>
  29.           <ToolTip>Replace this with name of the output file.</ToolTip>
  30.           <Default>"output.html"</Default>
  31.         </Literal>
  32.         <Literal>
  33.           <ID>xslFile</ID>
  34.           <Type>String</Type>
  35.           <ToolTip>Replace this with xsl stylesheet filename.</ToolTip>
  36.           <Default>"stylesheet.xsl"</Default>
  37.         </Literal>
  38.         <Literal>
  39.           <ID>xmlFile</ID>
  40.           <Type>String</Type>
  41.           <ToolTip>Replace this with name of the XML data file.</ToolTip>
  42.           <Default>"data.xml"</Default>
  43.         </Literal>
  44.       </Declarations>
  45.       <Code Language="VB" Kind="method body"><![CDATA[Using stream As FileStream = File.Open($outputFile$, FileMode.Create)
  46.             ' Create XsltCommand and compile stylesheet.
  47.             Dim processor As New XslCompiledTransform()
  48.             processor.Load($xslFile$)
  49.             ' Transform the file.
  50.             processor.Transform($xmlFile$, Nothing, stream)
  51.         End Using]]></Code>
  52.     </Snippet>
  53.   </CodeSnippet>
  54. </CodeSnippets>